<%--
  Created by IntelliJ IDEA.
  User: 我的大名叫陆健伟
  Date: 2016/2/17
  Time: 17:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style type="text/css">
    <%--.pageFormContent .textInput {--%>
    <%--width: 320px;--%>
    <%--}--%>
    <%--.pageFormContent .fix_p { width: 500px; float: none;}--%>
    <%--.gray {--%>
    <%--color: gray;--%>
    <%--}--%>
    .pageFormContent .textInput {
        width: 320px;
    }
    .pageFormContent .fix_p { width: 500px; float: none;}
</style>

<div class="pageContent">
    <form id="pagerForm" method="post" action="<c:url value='/situation/addSituation'/>" class="pageForm required-validate"
          onsubmit="return validateCallback(this,callbackForSubmit)" rel="dlg_sys_user_edit" >
        <div class="pageFormContent" style="height:300px">
            <p class="fix_p">
                <label for="txt_situation_highwayName" class="required">高速路名称</label>
                <input id="txt_situation_highwayName" type="text" name="highwayName" maxlength="30" class="required"  value="${situation.highwayName }"/>
            </p>
            <p class="fix_p">
                <label for="txt_situation_ar">部　　门</label>
                <select id="txt_situation_ar" name="area" class="combox">
                    <option value="00">辖区</option>
                    <option value="01">全省</option>
                </select>
            </p>
            <p class="fix_p">
                <label for="txt_situation_releaseUnit" class="required">发布单位</label>
                <input id="txt_situation_releaseUnit" type="text" name="releaseUnit" readonly  value="${loginUserOrg}"/>
            </p>
            <p class="fix_p">
                <label for="txt_situation_hwSituation">路　　况</label>
                <select id="txt_situation_hwSituation" name="highwaySituation" class="combox">
                    <option value="10">入口关闭</option>
                    <option value="20">通行正常</option>
                    <option value="30">交通拥堵</option>
                </select>
            </p>
            <p class="fix_p">
                <label for="txt_situation_relTime" class="required">时　　间</label>
                    <input id="txt_situation_relTime" type="text" name="releaseTime" readonly  value="<fmt:formatDate value='${situation.releaseTime}' pattern='yyyy-MM-dd HH:mm:ss'/>"/>
            </p>
            <p class="fix_p">
                <label for="txt_situation_detail">路况明细</label>
                <textarea id="txt_situation_detail" name="situationDetail" maxlength="1000" cols="90" rows="8">${situation.situationDetail }</textarea>
            </p>
            <input type="hidden" name="id" value="${situation.id}">
            <input type="hidden" name="isAddSituation" value="${isAddSituation}">
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">提交</button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">取消</button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script>
    $(function(){

        $("#txt_situation_ar").val("${situation.area}");
        $("#txt_situation_hwSituation").val("${situation.highwaySituation}");
        var timeInput = $("#txt_situation_relTime");
        if(timeInput.val() == ""){
            var time = new Date();
            time = time.getFullYear() + "-" + (time.getMonth()+1) + "-" + time.getDate() + " " + time.getHours() +":" + time.getMinutes() + ":" + time.getSeconds();
            timeInput.val(time);
        }
    });

    function callbackForSubmit(resp, st, xhr) {
        if (resp && resp.succ) {
            alertMsg.info(resp.msg);
            $.pdialog.closeCurrent();
            navTab.reloadFlag("page_app_list");
        } else {
            alertMsg.info(resp.msg + "!");
        }
    }

</script>